package com.wjbgn.bsolver.server.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

/**
 * Description:
 * Create Date: 2022-04-16T16:09:33.187
 *
 * @author wjbgn
 * @version 1.0
 */
@Data
@Document(indexName = "bsolver_bug_record", shards = 3, replicas = 1)
public class BugRecordDO {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /**
     * 问题名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title;

    /**
     * 问题描述
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String description;


    /**
     * 问题内容
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    /**
     * 问题提出者
     */
    @Field(type = FieldType.Keyword)
    private String username;

    /**
     * 问题状态：1已提出未回答，2已回答，3已关闭
     */
    @Field(type = FieldType.Keyword)
    private Integer status;

    /**
     * 问题分类，逗号分隔
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String category;

    /**
     *
     */
    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime createTime;

    /**
     *
     */
    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime updateTime;

    /**
     * 是否删除，1是，0否
     */
    @Field(type = FieldType.Keyword)
    private Integer isDelete;

    /**
     * 查看数量
     */
    @Field(type = FieldType.Integer)
    private Integer views;

    /**
     * 回答数量
     */
    @Field(type = FieldType.Integer)
    private Integer answers;
}
